package com.erbao.dp.templatemethod;

abstract class F{
    void m(){
        op1();
        op2();
    }

    protected abstract void op2();

    protected abstract void op1();
}

class C1 extends F{

    @Override
    protected void op2() {
        System.out.println(getClass().getName()+":op2");
    }

    @Override
    protected void op1() {
        System.out.println(getClass().getName()+":op1");
    }
}
/**
 * @author CaoBaoYin
 * @since 2021/10/18 8:13
 */
public class Main {

    public static void main(String[] args) {
        F f = new C1();
        f.m();
    }
}
